#ifndef HTTPSERVERHANDLER_H
#define HTTPSERVERHANDLER_H

#include <../httpserver/httprequesthandler.h>
#include <../httpserver/httprequest.h>
#include <../httpserver/httpresponse.h>
#include "businesslogic.h"

namespace stefanfrings {

class HttpServerHandler : public HttpRequestHandler {
    Q_OBJECT
public:
    HttpServerHandler(QObject* parent = nullptr);
    void service(HttpRequest& request, HttpResponse& response) override;

private:
    BusinessLogic* businessLogic; // 业务逻辑实例
    // 处理不同路径的请求
    void handleGetAttendList(HttpRequest& request, HttpResponse& response);
    void handleAddAttendRecord(HttpRequest& request, HttpResponse& response);
    void handleRegisterEmployee(HttpRequest& request, HttpResponse& response);
};

} // namespace

#endif // HTTPSERVERHANDLER_H
